<?php 
/*
Template Name: HomePage
*/

get_header(); ?>

<hr />

<div id="wrapper">
<div id="content">

<!-- Arcslab Description -->
<div id="intro" class="box">
<h2>Activities</h2>
	<p> In the ARCSLAB laboratory students and researchers study models and technologies related to the development of adaptive, cognitive and relational systems.
		Some research topics are:
	</p>

	<ul>
		<li> The multi-channel access to online information and services.</li>
		<li> The multi-modal communication and storytelling.</li>
		<li> The virtual environment for rehabilitation and training.</li>
		<li> The automatic processing of language.</li>
		<li> Particular attention is given to applications for weakness, distress and disability.</li>
	</ul>
</div>

<div id="latestnews">
<h2>Latest News</h2>
<?php 
	//Prendo le latest news (le ultime 4)
	$type = 'post';
	$args=array(
		'post_type' => $type,
		'post_status' => 'publish',
		'paged' => $paged,
		'posts_per_page' => 4,
		'caller_get_posts'=> 1
	);
	$wp_query = null;
	$wp_query = new WP_Query($args);			
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
	<?php 
     $time = get_the_time(_c('M d Y|Dates','stardust'));
     list($mo, $da, $ye) = explode(" ", $time);
	?>
  <div class="date" title="<?php the_time(_c('d-m-Y|Dates','stardust')); ?>">
    <p>
         <span class="mese"><?php echo($mo); ?></span>
         <span class="giorno"><?php echo($da); ?></span>
         <span class="anno"><?php echo($ye); ?></span>
    </p>
    </div>
	 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
	<div class="meta">
		<!-- NOTICE: we removed categories <span class="tags"><?php _e("Category:"); ?> <?php the_category(',') ?></span> &#8212; -->
		<span class="user"><?php the_author() ?> <!--NOTICE: remove timestamp @ <?php the_time() ?> --></span> 
		<?php edit_post_link(__('Edit This')); ?>
	</div>

	<div class="storycontent">
		<?php the_content(__('Continue reading ','stardust') . the_title('"', '"', false)); ?>

		<?php if (function_exists('the_tags')): ?>
    <p class="meta"><?php the_tags(__('Tags: ').' ',', '); ?></p>
		<?php endif;?>
	</div>
<!--
	<div class="feedback">
		<?php wp_link_pages(); ?>
		<p><?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?></p>
	</div>
-->
</div>
<hr />
<?php comments_template(); // Get wp-comments.php template ?>

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<!-- Here we don't want to have the possibility to go to the next page.
	There's the 'News' Page for that.
<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
-->
</div>

<!-- Login Form -->
<div id="login">
<?php if ( is_user_logged_in() ) { 

	global $current_user;
    get_currentuserinfo();

    echo 'Welcome ' . $current_user->user_login;  ?>
	<br/>
	<a href="<?php echo wp_logout_url(site_url('')); ?>">Logout</a>
	
	<?php
	} else { 
	$args = array(
        'echo' => true,
        'redirect' => site_url(''), 
        'form_id' => 'loginform',
        'label_username' => __( 'Username' ),
        'label_password' => __( 'Password' ),
        'label_remember' => __( 'Remember Me' ),
        'label_log_in' => __( 'Log In' ),
        'id_username' => 'user_login',
        'id_password' => 'user_pass',
        'id_remember' => 'rememberme',
        'id_submit' => 'wp-submit',
        'remember' => true,
        'value_username' => NULL,
        'value_remember' => false );
		
		wp_login_form( $args ); 
	}
?> 
</div>
<!-- Arcslab Credits -->
<div id="credits" class="box">
	<h2>Credits</h2>
	<p>
		Fit here the Arcslab description.
		Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
		Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
	</p>	
</div>	

<?php get_footer(); ?>
